package org.jmc.refmanager.domain.service.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BusinessException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	private static final Logger logger = LoggerFactory.getLogger("EXCEPTION");
	
	/**
	 * 
	 */
	public BusinessException() {
		super();
	}

	/**
	 * @param msg
	 * @param t
	 */
	public BusinessException(String msg, Throwable t) {
		super(msg, t);
		logger.error("Impossible d'enregistrer l'utilisateur", t);
	}

	/**
	 * @param msg
	 */
	public BusinessException(String msg) {
		super(msg);
		logger.error(msg);
	}

	/**
	 * @param msg
	 */
	public BusinessException(String msgFmt, Object... msgArgs) {
		super(String.format(msgFmt, msgArgs));
		logger.error(String.format(msgFmt, msgArgs));
	}

	/**
	 * @param t
	 */
	public BusinessException(Throwable t) {
		super(t);
		logger.error(t.getMessage());
	}

}
